package cn.sxgan.gen.services.base;

import cn.sxgan.gen.config.DataSourceConfig;
import cn.sxgan.gen.model.GlobalDataSource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 数据源服务
 * @Author: sxgan
 * @Date: 2025-07-19 09:58
 * @Version: 1.0
 **/
@Slf4j
@Service
public class DataSourceService {
    
    @Autowired
    DataSourceConfig dataSourceConfig;
    
    public List<GlobalDataSource> getAllDataSources() {
        return dataSourceConfig.getAllDataSourceInfo();
    }
    
    public GlobalDataSource getActiveDataSource() {
        return dataSourceConfig.getActiveDataSource();
    }
}
